<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <img :src="publicUrls + 'free/style9/firstLevelStyle1BackShadow.png?imageView2/3/format/webp'" alt="" class="bg-shadow" />
    <div
      class="outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style9/firstLevelStyle3Bg.png?imageView2/format/webp'})`,
      }"
    >
      <img
        :src="publicUrls + 'free/style9/firstLevelStyle3Img.png?imageView2/format/webp'"
        alt=""
        class="outline-img"
      />
      <div class="outline-content-left">
        <div class="color-block block1" v-if="props.info.text.length < 13"></div>
        <p class="title">{{ props.info.text }}</p>
        <div class="color-block block2" v-if="props.info.text.length < 13"></div>

        <div class="showroom-parent" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
        </div>
      </div>
      <div
        class="outline-content-right"
        :class="{ 'null-sub-title': !props.info.subTitle, 'null-unit-img': !props.info.value }"
      >
        <div class="sub-title-box" v-if="props.info.subTitle">
          <div class="sub-title">——{{ props.info.subTitle }}</div>
        </div>
        <div
          class="outline-img-box"
          :class="{ 'outline-img-box2': !props.info.remarks }"
          :style="{
            backgroundImage: !props.info.remarks
              ? `url(${publicUrls + 'free/style9/firstLevelStyle3Icon2.png?imageView2/format/webp'})`
              : `url(${publicUrls + 'free/style9/firstLevelStyle3Icon.png?imageView2/format/webp'})`,
          }"
          v-if="props.info.value"
        >
          <div class="unit-img-bg">
            <div class="height-box" v-if="!props.info.remarks">
              <img
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/format/webp'"
                alt=""
                class="unit-img"
              />
            </div>
            <div class="width-box" v-if="!props.info.remarks">
              <img
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/format/webp'"
                alt=""
                class="unit-img"
              />
            </div>
            <!-- <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" class="unit-img" /> -->
            <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 276 260" fill="none" v-else>
              <g filter="url(#filter0_i_907_17063)">
                <path
                  fill-rule="evenodd"
                  clip-rule="evenodd"
                  d="M34 0C25.1634 0 18 7.16344 18 16V18H16C7.16344 18 0 25.1635 0 34V226C0 234.837 7.16344 242 16 242H18V244C18 252.837 25.1634 260 34 260H242C250.837 260 258 252.837 258 244V242H260C268.837 242 276 234.837 276 226V34C276 25.1634 268.837 18 260 18H258V16C258 7.16344 250.837 0 242 0H34Z"
                  fill="#D9D9D9"
                  fill-opacity="0.01"
                />
              </g>
              <defs>
                <clipPath id="myClip">
                  <path
                    d="M34 0C25.1634 0 18 7.16344 18 16V18H16C7.16344 18 0 25.1635 0 34V226C0 234.837 7.16344 242 16 242H18V244C18 252.837 25.1634 260 34 260H242C250.837 260 258 252.837 258 244V242H260C268.837 242 276 234.837 276 226V34C276 25.1634 268.837 18 260 18H258V16C258 7.16344 250.837 0 242 0H34Z"
                  />
                </clipPath>

                <filter
                  id="filter0_i_907_17063"
                  x="0"
                  y="0"
                  width="276"
                  height="260"
                  filterUnits="userSpaceOnUse"
                  color-interpolation-filters="sRGB"
                >
                  <feFlood flood-opacity="0" result="BackgroundImageFix" />
                  <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
                  <feColorMatrix
                    in="SourceAlpha"
                    type="matrix"
                    values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
                    result="hardAlpha"
                  />
                  <feOffset />
                  <feGaussianBlur stdDeviation="5" />
                  <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
                  <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" />
                  <feBlend mode="normal" in2="shape" result="effect1_innerShadow_907_17063" />
                </filter>
              </defs>
              <image
                @click="ImgVisible = true"
                clip-path="url(#myClip)"
                :xlink:href="urls + props.info.value + '?imageView2/3/format/webp'"
                width="100%"
                height="100%"
                x="0"
                y="0"
                preserveAspectRatio="none"
              />
            </svg>
          </div>
        </div>
        <div class="remarks1" v-if="props.info.value">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="9"
          ></TextMax>
        </div>
        <div class="remarks2" v-else-if="props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.subTitle ? 16 : props.info.value ? 7 : 16"
          />
        </div>
        <div class="line-box" v-if="props.info.remarks">
          <div class="line"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style3',
});
</script>
<script lang="ts" setup>
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style9.vue';
import TextMax from '@/freeComponents/textMode/TextMax9.vue';
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();
const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  position: relative;
  margin-right: 160px;
}
.bg-shadow {
  position: absolute;
  bottom: 0;
  left: 10px;
  z-index: 10;
  width: 770px;
  height: 230px;
}
.outline-parent-bg {
  position: relative;
  z-index: 11;
  width: 600px;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
}
.outline-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  object-fit: cover;
}
.outline-content-left {
  position: relative;
  width: 190px;
  display: flex;
  justify-content: center;
  padding-top: 58px;
}
.color-block {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 80px;
  background: #dcceb9;
  flex-shrink: 0;
}
.block1 {
  top: 58px;
}
.block2 {
  bottom: 116px;
}
.title {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 694px;
  writing-mode: vertical-rl;
  color: #8a7a6a;
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  line-height: 38px; /* 118.75% */
  letter-spacing: 6px;
}
.showroom-parent {
  position: absolute;
  bottom: 70px;
  left: 80px;
  z-index: 21;
  width: 40px;
  height: 40px;
}
.outline-content-right {
  width: 366px;
  height: calc(100% - 68px);
  padding: 34px 0;
  display: flex;
  flex-direction: column;
}
.null-sub-title {
  justify-content: flex-end;
}
.null-unit-img {
  padding-top: 100px;
  .remarks2 {
    margin-top: 60px;
  }
}
.sub-title-box {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-title {
  color: #8a7a6a;
  width: 300px;
  text-align: center;
  /* 一级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
}
.outline-img-box {
  position: relative;
  width: 343px;
  height: 332px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-top: 20px;
  // padding-right: 23px;
}
.outline-img-box2 {
  height: 100%;
  border-bottom: 3px solid #baac96;
  .unit-img-bg {
    height: calc(100% - 40px) !important;
  }
}
.unit-img-bg {
  position: absolute;
  top: 20px;
  right: 0;
  width: 276px;
  height: 260px;
  border-radius: 16px;
  // background: #d9d9d9;
  .height-box {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 36px);
    height: 100%;
    background: #dcceb9;
    border-radius: 16px;
  }
  .width-box {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: calc(100% - 36px);
    background: #dcceb9;
    border-radius: 16px;
  }
  .wrap {
    width: 100%;
    height: 100%;
    position: relative;
    &::after {
      content: '';
      width: 100%;
      height: 100%;
      position: absolute;
      left: -20px;
      top: 0;
      border: 1px solid #1890ff;
      border-radius: 20px;
    }
    &::before {
      content: '';
      width: 100%;
      height: 100%;
      position: absolute;
      right: -0px;
      top: 20px;
      border: 1px solid #1890ff;
      border-radius: 20px;
    }
  }
}
.unit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}
.remarks1 {
  flex-shrink: 0;
  padding: 0 23px;
  margin-top: 20px;
}
.remarks2 {
  flex-shrink: 0;
  padding: 0 23px;
}
.line-box {
  width: 100%;
  padding: 0 23px;
  margin-top: 32px;
}
.line {
  // flex-shrink: 0;
  width: 320px;
  height: 3px;
  background: #baac96;
  box-shadow: 0px 0px 1.2px 0px #9a8b74 inset;
  // filter: drop-shadow(0px 0px 1px #ebe0d0);
}
</style>
